BeyondPress lets you embed Apple Events scripts in master elements. Each time you export the article, the script is executed. Examples of scripts embedded in master elements include:
• A script that references a text file that is common to all your Web pages. When you export an article containing this master element, the script will insert the current version of that text file.
• A script that finds a price from a database. When you export an article containing this master element, the script will insert the current price from the database.
• A script that provides an alternative to the Date and/or Time master elements. If you export your articles before you post the Web pages, you could run a script that post-dates the exported pages.
Embedding a Script in a Master Element
1. Create a folder called "$" in your QuarkXPress folder; place the scripts you're planning to embed in the $ folder.
2. In Master Elements Preferences, create a new master element or edit an existing one.
3. In the HTML Text field of the Edit Master Element dialog box, enter the script referencing information as follows:
• enclose the information in brackets { }
• enter a $ sign immediately followed by the name of the script file
• enter the name of any function called
• enter the parameter for the function in parentheses and quotes
For example:
{$SampleScript include("some file name")}
The data returned must be a text string. A sample script is shown below.
4. Export the article to execute the script.
Sample Script
This script locates a text file and inserts it in a master element when you export an article. You can paste the script below into your Script Editor to give it a try.